﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/User/ViewMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <title>Forms</title>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftMenuContent" runat="server">
    <li><a href="/User/Index"><span class="glyphicon glyphicon-dashboard"></span>首页</a></li>
    <li><a href="/User/Widgets"><span class="glyphicon glyphicon-th"></span>医生</a></li>
    <li><a href="/User/Charts"><span class="glyphicon glyphicon-stats"></span>实时数据</a></li>
    <li><a href="/User/Tables"><span class="glyphicon glyphicon-list-alt"></span>数据历史</a></li>
    <li class="active"><a href="/User/Forms"><span class="glyphicon glyphicon-pencil"></span>病历</a></li>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
        <div class="row">
            <ol class="breadcrumb">
                <li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
                <li class="active">病历</li>
            </ol>
        </div>
        <!--/.row-->

        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">病历</h1>
            </div>
        </div>
        <!--/.row-->


        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">病历窗口</div>
                    <div class="panel-body">
                        <div class="col-md-8">
                            <form role="form">
                                <div class="form-group">
                                    <label>姓名</label>
                                    <input class="form-control" placeholder="Placeholder" value="<%:ViewData["UserName"] %>" readonly>
                                </div>

                                <div class="row">
                                    <div class="col-xs-4">
                                        <div class="form-group">
                                            <label>科室：</label>
                                            <div class="form-group">
                                                <input class="form-control" placeholder="" value="<%:ViewData["UserOffice"] %>" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xs-4">
                                        <label>年龄：</label>
                                        <input class="form-control" id="old_TxtBox_Update" value="<%:ViewData["UserOld"] %>" readonly>
                                    </div>
                                    <div class="col-xs-4">
                                        <label>性别：</label>
                                        <div class="form-group">
                                            <input class="form-control" placeholder="" value="<%:ViewData["UserSex"] %>" readonly>
                                        </div>
                                    </div>

                                </div>

                                <div class="row">
                                    <div class="col-xs-4">
                                        <label>身高：</label>
                                        <input class="form-control" id="height_TxtBox_Update" readonly value="<%:ViewData["UserHeight"] %>">
                                    </div>
                                    <div class="col-xs-4">
                                        <label>体重：</label>
                                        <input class="form-control" id="wigh_TxtBox_Update" readonly value="<%:ViewData["UserWeight"] %>">
                                    </div>
                                    <div class="col-xs-4">
                                        <div class="input-append date form_datetime">
                                            <label>入院时间</label>
                                            <input size="16" type="text" value="<%:ViewData["UserTime"] %>" readonly class="form_datetime1 form-control" id="time_select_Update">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label>联系电话：</label>
                                    <input class="form-control" id="tel_TxtBox_Update" readonly value="<%:ViewData["UserTel"] %>">
                                </div>

                                <div class="form-group">
                                    <label>邮箱：</label>
                                    <input class="form-control" id="email_TxtBox_Update" readonly value="<%:ViewData["UserEmail"] %>">
                                </div>

                                <a></a>
                                <div class="form-group">
                                    <label>病情诊断</label>
                                    <textarea class="form-control" rows="8" readonly id="txtBox_history"></textarea>
                                </div>
                            </form>
                        </div>
                        <div class="col-md-4">

                            <div class="panel panel-red">
                                <div class="panel-heading dark-overlay panel-red"><span class="glyphicon glyphicon-calendar"></span>日历</div>
                                <div class="panel-body">
                                    <div id="calendar"></div>
                                </div>
                            </div>

                            <div class="row">
                                <label>主治医生：</label>
                                <input class="form-control" readonly value="<%:ViewData["UserDoctor"] %>">
                            </div>
                            <div class="row">
                                <label>医生电话：</label>
                                <input class="form-control" readonly value="<%:ViewData["UserDoctorTel"] %>">
                            </div>
                            <div class="row">
                                <label>医生邮箱：</label>
                                <input class="form-control" readonly value="<%:ViewData["UserDoctorEmail"] %>">
                            </div>

                        </div>

                        <!--/.col-->
                    </div>
                </div>
            </div>
            <!-- /.col-->
        </div>
        <!-- /.row -->
    </div>
    <!--/.main-->
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="JsContent" runat="server">
    <script>
        var time_old, time
        $('#calendar').datepicker({
        });
        $(document).ready(function () {
            time = getNowFormatDate(new Date());
            $.post("/User/GetHistory", { "time": time }, function (data) {
                $('#txtBox_history').val(data);
            });
        });
        $('#calendar').click(function () {
            time = getNowFormatDate($('#calendar').datepicker('getDate'));
            if ((time != time_old) && (time != 'NaN-NaN-NaN')) {
                time_old = getNowFormatDate($('#calendar').datepicker('getDate'));
                $.post("/User/GetHistory", { "time": time }, function (data) {
                    $('#txtBox_history').val(data);
                });
            }
        });
        function getNowFormatDate(get_date) {
            var date = get_date;
            var seperator1 = "-";
            var seperator2 = ":";
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            if (month >= 1 && month <= 9) {
                month = "0" + month;
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = "0" + strDate;
            }
            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
            return currentdate;
        }

    </script>

</asp:Content>
